Az.Tools.Predictor refactor and performance improvement.#13669
Merged
dingmeng-xue merged 15 commits intoAzure:masterfrom Dec 15, 2020
Merged
Az.Tools.Predictor refactor and performance improvement.#13669dingmeng-xue merged 15 commits intoAzure:masterfrom
dingmeng-xue merged 15 commits intoAzure:masterfrom
Conversation
- Improve the comment and its format. - Create a concret class type to replace Tuple and ValueTuple. - Verify method parameter values.
- Combine the error telemetry event with the non-error one. - Collect if the http request is canceled when we send http request.
- Refactor the telemetry and use a class for the collected data in each telemetry event. - Now we only get basic information and push them to the data flow. - A thread from thread pool handles the data, transform them, and send it.
- Updated the test after the refactor. - Add more test cases. - We don't set SuggestionSource on the suggestion in some cases. This is revealed in the unit tests. They're fixed.
- We have two CommandLinePredictor in AzurePredictorService. The CommandLinePredictor needs to extract from the user input the command name, parameter set etc. It's duplicate if we do that in both CommandLinePredictor. Move that extraction to AzurePredictorService and the CommandLinePredictor will not need to do it.
- Remove the string manipulation. - Pre-allocate the collections for the result. - Remove invariant check in "readonly" properties.
mirdaki
reviewed
Dec 4, 2020
|
Looks good to me! |
mirdaki
approved these changes
Dec 14, 2020
baopingz
reviewed
Dec 14, 2020
| /// <returns>true if allowed.</returns> | ||
| private static bool IsDataCollectionAllowed() | ||
| { | ||
| if (AzurePSDataCollectionProfile.Instance.EnableAzureDataCollection == true) |
There was a problem hiding this comment.
nit: just return AzurePSDataCollectionProfile.Instance.EnableAzureDataCollection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There are a few things going on during the refactor: telemetry, readability, and performance.
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added